<h3>Educational History</h3>

<p>
  <?php echo $info ?>
</p>
<div id="school_list">
	<?php echo $this->Session->flash('sl'); ?>
	
	<span>Added Schools</span>
	<table cellpadding="0" cellspacing="0">
	<tr><th>School Name:</th><th>Start Date:</th><th>End Date:</th><th>Degree:</th><th>Majors/Minors:</th><th>Delete:</th></tr>
<?php
	$line = 1;
	foreach ($data as $sch) {
		echo (($line++)% 2==1)? '<tr class="odd">': '<tr class="even">';
		echo "\n<td>{$sch['School']['schoolname']}</td>";
		
		$dt = explode( '-', $sch['School']['start_date']);
		echo "<td>{$dt[1]}/{$dt[0]}</td>";
		
		$dt = explode( '-', $sch['School']['end_date']);
		echo "<td>{$dt[1]}/{$dt[0]}</td><td>{$sch['School']['degrees']}</td><td>{$sch['School']['major_minor']}</td><td>";
		echo $this->Js->link('delete', 
						array('controller' => 'Schools', 'action' => 'delete',  $sch['School']['id']), 
						array('update' => '#school_list'));
		echo "</td></tr>";
	}
?>
	</table>
</div><!--end schoollist-->
<?php echo $this->Form->create('School', array('action' => 'add', 'default' => false)); ?>
	<fieldset>
		<?php echo $this->Form->input('application_id', array('type' => 'hidden', 'value' => $app_id)); ?>
		<?php echo $this->Form->input('schoolname', array('label' => 'School Name')); ?>	
		<?php echo $this->Form->input('start_date', array('type' => 'date', 
    																							'minYear' => date('Y') - 70,
     																							'maxYear' => date('Y') + 2 )); ?>
		<?php echo $this->Form->input('end_date', array( 'type' => 'date',
    																							'minYear' => date('Y') - 70,
     																							'maxYear' => date('Y') + 2 )); ?> 
		<?php echo $this->Form->input('major_minor', array('label' => 'Program of Study (Majors/Minors)')); ?>	
		<?php echo $this->Form->input('degrees', array('label' => 'Degree\'s Earned')); ?>	
	</fieldset>
	<?php  echo $this->Js->submit('Add School', array('update' => '#school_list', 'url' => array('controller' => 'Schools', 
	                                                                                             'action' => 'add', $app_id))); ?>
<?php echo $this->Form->end(); ?>

